{% extends '../../layout.html' %}
<!-- header-start -->
{% block head %}
{% parent %}

<!--lCalendar.css-->
<link href="/component/lCalendar/lCalendar.css" rel="stylesheet"/>
<!--LArea.css-->
<link href="/component/LArea/LArea.min.css" rel="stylesheet"/>
<style type="text/css">
    body {
        margin: 0;
        padding: 0;
        -webkit-box-shadow: none;
    }

    body {
        overflow: -Scroll;
        overflow-y: hidden;
    }

    ::-webkit-scrollbar {
        width: 0;
        height: 0
    }

    .btn_ifm {
        width: 100px;
        height: 30px;
        background: #4caada;
        outline: none;
        border: 1px solid #4caada;
        margin: 20px 100px;
    }
</style>
{% endblock %}
<!-- header-end -->

<!-- body-start -->
{% block content %}
<div style="background-color: rgb(235, 235, 237) !important;">
    {#<button class="btn_ifm">进入对话</button>#}
    <div id="iframe_show" style="background-color: rgb(235, 235, 237);position: absolute;left: 568px;"></div>
</div>

{% endblock %}
<!-- body-end -->
<!-- script-start -->
{% block script %}
<!--lCalendar.js-->
<script type="text/javascript" src="/component/lCalendar/lCalendar.min.js"></script>
<!--LArea.js-->
<script type="text/javascript" src="/component/LArea/LArea.min.js"></script>
<!--LArea.Date-->
<script type="text/javascript" src="/component/lCalendar/LAreaData1.js"></script>
<script type="text/javascript" src="/js/base/app.js"></script>

<script type="text/javascript">
    $(function () {
        var header = 1;
        var iframechat = 0;
//        var btn = $('.btn_ifm');
        var div_ifm = $("#iframe_show").get(0);
        var ifm_src = "http://downt.ntalker.haier.net/t2d/chat.php?siteid=kf_1023&settingid=kf_1023_1481772050374&baseuri=http%3A%2F%2Fdownload.ntalker.haier.net%2Fjs%2Fxn6%2F&mobile=1";
        var ifm_src_login = ifm_src + "&iframechat=" + iframechat + "&header=" + header;
        var height = document.documentElement.clientHeight;
        var width = document.documentElement.clientWidth;
//        btn.click(function () {
//            $(this).css('display', "none");
//            show();
//            start();
//        });
            show();
            start();
        function show() {
            $('#iframe_show').append('<iframe src="' + ifm_src_login + '" frameborder="0" style="width:' + width + 'px;height:' + height + 'px;"></iframe>')
        }

        // 控制iframe移动
        function start() {
            var timer = setInterval(function () {
                if (div_ifm.offsetLeft <= 0) {
                    div_ifm.style.left = 0 + 'px';
                    clearInterval(timer);
                } else {
                    div_ifm.style.left = div_ifm.offsetLeft - 15 + 'px';
                }
            }, 20);
        }

        // 横竖屏变换
        window.onresize = function () {
            $('#iframe_show').css({
                'width': document.documentElement.clientWidth,
                'height': document.documentElement.clientHeight,
                "overflow-y": "hidden"
            });
            $('iframe').css({
                'width': document.documentElement.clientWidth,
                'height': document.documentElement.clientHeight,
                "overflow-y": "hidden"
            });
        }
    })
</script>
{% endblock %}